import javafx.application.Application;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Test {
	public static void main(String[] args) throws IOException {
		ApplicationContext app = new ClassPathXmlApplicationContext("application.xml");
		Object member = app.getBean("member");

		BeanFactory bf = new XmlBeanFactory(new ClassPathResource("application.xml"));
		Resource resource = new ClassPathResource("application.xml");
		InputStream inputStream = resource.getInputStream();

//		Test test = TestAware.getBean("test");
//
//
//
//
//
//
//
//
//		Map<Object, Object> cmap = new ConcurrentHashMap<>();
//		for(int i = 0; i<10; i++){
//			new Thread(()->{
//				if(!cmap.containsKey("test")){
//					try {
//						Thread.sleep(100);
//					} catch (InterruptedException e) {
//						e.printStackTrace();
//					}
//					Object obj = new Object();
//					System.out.println("new obj" + cmap.put("test", obj));
//				}else{
//					System.out.println("exist obj" + cmap.get("test"));
//				}
//			}).start();
//		}
	}

}
